#ifndef __usart_H
#define __usart_H

#include "system.h" 

#define BUFF_SIZE 1024
void USART1_Init(u32 bound);

extern u8 rx_tx_buff[BUFF_SIZE];
extern u8 rx_tx_buff1[BUFF_SIZE];
extern int rxCount;
extern int txCount;
extern int buffMutex;
extern u8 txComplete;
extern u8 isNeedWait;

void addToBuff(u8 rxData);
u8 getFromBuff(void);

void addToBuff1(u8 rxData);
u8 getFromBuff1(void);

#define RS485_TX_EN		PAout(1)
void RS485_Init(u32 bound);

extern int sendMutex;

void rs485_sendByte(u8 data);


#endif


